<!--
	作者：2575202388@qq.com
	时间：2018-10-14
	描述：首页我的信息
-->

<template>
    <Card :bordered="false" style="height:430px;">
        <p slot="title">
        	<Icon type="ios-pulse" style="color:#07a1be;font-size: 18px;"/>
        	<span style="padding-left:2px;font-weight: normal;">登记统计三</span>
        </p>
        <div style="width:100%;float:left;text-align: center;margin:0 auto;display:table;" align="center">	
      		<div ref="static3" style="width:100%;min-width: 600px; float:left;height:330px;"></div>
        </div>
    </Card>
</template>

<script>
	import Highcharts from 'highcharts'
	require('highcharts/modules/exporting')(Highcharts);
	export default {
		name:"static3",
		props: {
    		camlist:{
    			type: Array
    		}
    	},
		mounted(){
		},
		methods: {
		    drawLine(){	
		     	var camlist=this.camlist;
		     	var carr=[];
		     	var varr=[];
		     	for(var i=0;i<camlist.length;i++){
		     		carr.push(camlist[i].CSNAME);
		     		if(camlist[i].COALL){
		     			varr.push(camlist[i].COALL);
		     		}else{
		     			varr.push(0);
		     		}
		     	}

		    	var chart = Highcharts.chart(this.$refs.static3, {
					title: {
						text: '学校登记统计表'
					},
					xAxis: {
						categories: carr
					},
					lang:{ 
						downloadJPEG: "下载JPEG 图片",  
						downloadPDF: "下载PDF文档"  ,
						downloadPNG: "下载PNG 图片",
						downloadSVG: "下载SVG 矢量图" , 
						exportButtonTitle: "导出图片"  ,
				    },  
					yAxis: {
				        min: 0,
				        title: {
				            text: '人数'
				        }
				    },
					plotOptions: {
						series: {
							stacking: 'normal'
						}
					},
					labels: {
						items: [{
							html: '学校登记人数',
							style: {
								left: '100px',
								top: '18px',
								color: (Highcharts.theme && Highcharts.theme.textColor) || 'black'
							}
						}]
					},
					series: [{
						type: 'column',
						name: '学校登记人数',
						data: varr
					}, {
						type: 'spline',
						name: '走向图',
						data: varr,
						marker: {
							lineWidth: 2,
							lineColor: Highcharts.getOptions().colors[3],
							fillColor: 'white'
						}
					}]
				});

		    }
		},
		watch:{
			camlist(news,olds){
				if(news){
					this.drawLine();
				}
			}
		},
	}
</script>

<style>

</style>



